<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>径向渐变</title>
    <style>
        .box1{
            width: 200px;
            height: 200px;
            border: 5px solid gray;
            /* background: radial-gradient(red 0%,green 10%,blue 20%); */
           /* 不均匀过度 */
            /* border-radius: 50%; */
            
            /* background: radial-gradient(red 50%,blue 50%);       */
            /* background: linear-gradient(red 50%,blue 60%); */
             /* 两种颜色分布比例一样就没有过渡效果 */
             background: radial-gradient(red ,green ,blue);
        }
        .box2{
            width: 300px;
            height: 100px;
            border: 5px solid gray;
            margin-top: 10px;
            /* background: radial-gradient(circle,red ,green ,blue); */
            /* circle渐变为最大圆形 默认为elipse椭圆形 */
            background: -webkit-radial-gradient(60% 40%,closest-side,blue,green,yellow,black)
            /* 
            closest-side 主要靠近边
            farthest-side 主要放大靠近远边
            closest-Corner 主要靠近角
            farthest-Corner 主要放大靠近远角
            */
            
            /* 
            -moz-
            */
        }
    </style>
</head>
<body>
    <div class="box1"></div>
    <div class="box2"></div>
</body>
</html>